package y_2025.m03.d09;

import java.util.*;

public class BucketSort {
    public static void main(String[] args) {
        int N;
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        // 待排序数组
        double[] array = new double[N];
        for (int i = 0; i < N; i++) {
            array[i] = scanner.nextDouble();
        }
        // 只有一个数没有间隙
        if (N < 2) {
            return;
        }

        // 对桶进行初始化
        int[] count = new int[N];
        double[] max = new double[N];
        double[] min = new double[N];
        double smallest = Double.NEGATIVE_INFINITY;
        double biggest = Double.POSITIVE_INFINITY;

        for (int i = 0; i < N; i++) {
            max[i] = smallest;
            min[i] = biggest;
            count[i] = 0;
        }

        // 找出梯队长度
        double MAX = array[0], MIN = array[0];
        for (int i = 1; i < N; i++) {
            if (array[i] > MAX) {
                MAX = array[i];
            }
            if (array[i] < MIN) {
                MIN = array[i];
            }
        }

        // 数字全都一样的情况
        if (MAX - MIN == 0) {
            return;
        }

        double len = (MAX - MIN) / (N - 1);

        // 把n个数放到n-1个桶中
        int index;
        for (int i = 0; i < N; i++) {
            index = (int) ((array[i] - MIN) / len);
            if (max[index] < array[i]) {
                max[index] = array[i];
            }
            if (min[index] > array[i]) {
                min[index] = array[i];
            }
            count[index]++;
        }

        // 计算最大间隙
        double Gap = len, last, now;
        for (int i = 0; i < N - 1; ) {
            int x = i;
            last = max[x];
            int y;
            if (count[i + 1] == 0) {
                while (count[++i] == 0) ;
                y = i;
            } else {
                y = i + 1;
            }
            now = min[y];
            if (now - last > Gap) {
                Gap = now - last;
            }
            i = y;
        }

        System.out.printf("%f", Gap);
    }
}